<script type=text/javascript>
	var allnotblank='<{$lang.allisnotblank}>';
	var passlength='<{$lang.passisnotlowfour}>';
	var passistooleng='<{$lang.passisnotlongtenw}>';
	var passnotsame='<{$lang.passisnotsame}>';
	var emailerror='<{$lang.emailiserror}>';
	var randcodeerror='<{$lang.codeiserror}>';
	var randcodeisemp='<{$lang.codeisempty}>';
	var rcodeiserror='<{$lang.randcodeerror}>';
	var enterusername='<{$lang.usernameisblank}>';
	var unameisfour='<{$lang.usernameislowfour}>';
	var unameisen='<{$lang.usernameisen}>';
	var usernameprotect='<{$lang.usernameisprotect}>';
	var have_blank='<{$lang.have_blank}>';
</script>
<script type=text/javascript>
	var nousername='<{$lang.nouname}>';
	var nouserpass='<{$lang.noupass}>';
	var norandcode='<{$lang.nocode}>';
</script>
<script src="script/my_lightbox.js" language="javascript"></script>
<script type="text/javascript" src="<{$config.weburl}>/lib/upload/swfupload/swfupload.js"></script>
<script type="text/javascript" src="<{$config.weburl}>/lib/upload/js/offer_handlers.js"></script>
<script type="text/javascript">
var swfu;	
window.onload = function (){
	swfu = new SWFUpload({
		//Backend Settings
		upload_url: "<{$config.weburl}>/lib/upload/upload.php",
		post_params: {"PHPSESSID": "<?php echo session_id(); ?>",'save_dir':'<{$upload.temp_dir}>','theight':<{$upload.theight}>,'twidth':<{$upload.twidth}>,'file_type':'<{$upload.file_type_param}>'},
		// File Upload Settings
		file_size_limit : "<{$upload.size_limit}>",	//like 2MB
		file_types : "<{$upload.file_type}>",
		file_types_description : "File",
		file_upload_limit : "0",
		file_post_name:'upload_file',
		
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,

		// Button Settings
		button_image_url : "<{$config.weburl}>/lib/upload/images/SmallSpyGlassWithTransperancy_17x18.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 180,
		button_height: 18,
		button_text : '<span class="button">选择文件<span class="buttonSmall">(2 MB Max)</span></span>',
		button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
		button_text_top_padding: 0,
		button_text_left_padding: 18,
		button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
		button_cursor: SWFUpload.CURSOR.HAND,
		
		// Flash Settings
		flash_url : "<{$config.weburl}>/lib/upload/swfupload/swfupload.swf",

		custom_settings : {
			upload_target : "divFileProgressContainer"
		},
		
		// Debug Settings
		debug:false
	});
<{if !$de}>
	$('sscatid').value = '';
	$('scatid').value = '';	
	$('tcatid').value = '';
	$('catid').value = '';
<{/if}>
};
</script>
<script>
function toggAddPro()
{
	if($('add_pro_online').checked==true){
		$('add_pro_tb').style.display='';
	}else{
		$('add_pro_tb').style.display='none';
	}
}
</script>
<script src="<{$config.weburl}>/script/register.js" type=text/javascript></script>
<link href="<{$config.weburl}>/lib/upload/css/default.css" rel="stylesheet">
<style>
.add_table{line-height:20px;}
.add_table th{
	text-align:right;
	width:110px;
	font-style:normal;
	font-weight:normal;
	padding:8px;
}
.add_table td{
	padding:6px 0px;
}
.admin_right_top,.add_table .smalltitle{
    background-color: #EFF2F9;
    color: #FF5400;
    font-size: 14px;
    font-weight: bold;
    height: 20px;
    line-height: 22px;
    padding: 5px;
	padding-left:20px;
}
#pic_view{width:100%}
#pic_view li{ float:left; width:55px;}
ul,li{
	list-style-type:none;
	list-style:none;
}
#attach_wrap{
	border:1px solid #DDDDDD;
	width:360px;
	padding-top:6px;
	overflow:hidden;
}
#thumbnails ul{
	border-top:1px dashed #DDDDDD;
    padding: 10px;
	margin-top:10px;
	padding-bottom:20px;
	overflow:hidden;
}
#thumbnails li{
	width:72px;
	height:100px;
	margin-left:15px;
	text-align:center;
	float:left;
}
#thumbnails li .complete_statu{
	border:#DDDDDD solid 1px;
	width:70px;
	display:block;
	height:70px;
}
#thumbnails li h4{
	padding:0;
	margin:0;
	display:inline-block;
	overflow:visible;
	font-size:11px;
	word-wrap: break-word;
	word-break:break-all;
	line-height:14px;
}
#thumbnails li .complete_statu img{
	width:68px;
	height:68px;
	vertical-align:middle;
	margin:0 auto;
}
</style>
<div class="menu_bottom L1">
  <div class="headtop_L"> <{$lang.you_are_here}><a href='<{$config.weburl}>/'><{$lang.indexpage}></a>&raquo; <{$lang.product_releases}></a> </div>
  <div class="headtop_R"></div>
</div>
<div id="mainbody1">
  <!--主体左侧开始 -->
  <div class="leftbar">
    <div class="maintitle"> <span class="title_t1"><{$lang.product_releases}></span> </div>
    <div class="maincontent">
      <form method="post" action="" enctype="multipart/form-data" id="add_frm" onsubmit="return false;">
        <table width="100%" border="0" align="center" cellpadding="6" cellspacing="1" class="add_table">
          <tr>
            <th><{$lang.type}>:</th>
            <td style="font-weight:normal"><label>
                <input type="radio" checked="checked" value="2" name="type" onclick="toggAddPro()" style="border:none;width:20px;">
                求购</label>
              &nbsp;&nbsp;
              <label>
                <input onclick="toggAddPro()" type="radio" id="add_pro_online"  name="type" value="" />
                在线销售</label></td>
          </tr>
          <tr>
            <th><font color="red">*</font><{$lang.titles}>:</th>
            <td><input maxlength="100" name="title" type="text" id="title" style="width:420px;" value="" /></td>
          </tr>
          <tr>
            <th valign="top"><{$lang.key_words}>:</th>
            <td><input name="keyword" id="key_word" type="text" value="" style="width:420px;" />
              <br>
              <{$lang.key_des}> </td>
          </tr>
          <tr>
            <th><font color="red">*</font><{$lang.category}>:</th>
            <td><span id="cate_show"><{$typenames}></span>&nbsp;
              <input type="button" onclick="showCategory();" value="<{$lang.select_business_category}>">
              <input name="catid" id="catid" type="hidden" value="" />
              <input name="tcatid" id="tcatid" type="hidden" value="" />
              <input name="scatid" id="scatid" type="hidden" value="" />
              <input name="sscatid" id="sscatid" type="hidden" value="" /></td>
          </tr>
          <{if $custom_cat}>
          <tr>
            <th><{$lang.cus_cat}>:</th>
            <td><select name="custom_cat" style="width:133px">
                <option value=""><{$lang.no_cat}></option>
                <{foreach item=list from=$custom_cat}> <{if $de.custom_cat_id==$list.id}>selected="selected"<{/if}> value="<{$list.id}>"><{$list.name}><option <{if $de.custom_cat_id==$list.id}>selected="selected"<{/if}> value="<{$list.id}>"><{$list.name}>
                </option>
                <{/foreach}>
              </select>
              [<a target="_blank" href="main.php?menu=<{$smarty.get.menu}>&action=admin_product_cat"><{$lang.mag_cat}></a>]</td>
          </tr>
          <{/if}>
          <tr>
            <th align="left" ><{$lang.price}>(<{$config.money}>):</th>
            <td  style="font-weight:normal"><input type="text" name="price" id="price" style="width:130px;" value="<{$de.price}>" />
              / <select name="unit" <{if !$de}>onchange="$('pro_unit_des').innerHTML='('+this.value+')'"<{/if}>>
              <{foreach item=list from=$unit}> <option <{if $list==$de.priceDes}>selected="selected"<{/if}> ><{$list}>
              </option>
              <{/foreach}>
              </select></td>
          </tr>
          <tr>
            <th><{$lang.specifications}>:</th>
            <td><input  type="text" id="gg" name="gg" style="width:170px;" value="<{$de.gg}>" /></td>
          </tr>
          <tr>
            <th><{$lang.model}>:</th>
            <td><input  type="text" id="model" name="model" style="width:170px;" value="<{$de.model}>" /></td>
          </tr>
          <tr>
            <th><{$lang.brand}>:</th>
            <td><span id="brand"><{if $brand==''}>
              <input type="text" value="<{$de.pp}>" style="width:170px;" name="pinpai" maxlength="20">
              <{else}><{$brand}><{/if}></span></td>
          </tr>
          <tr>
            <th valign="top"><font color="red">*</font><{$lang.summary}>:</th>
            <td><textarea maxlength="100" style="width:500px; height:60px;" name="con" id="con"><{$de.con}></textarea></td>
          </tr>
          <tr>
            <th><font color="red">*</font><{$lang.introduction}>:</th>
            <td><{if $de.detail}>
              <{$de.detail}>
              <{else}>
              <script type="text/javascript" src="lib/fckeditor/fckeditor.js"></script>
              <script type="text/javascript">
			var oFCKeditor = new FCKeditor( 'detail' ) ;
			oFCKeditor.Config['ToolbarStartExpanded'] = true ;
			<{if $config.language=='en'}>
				oFCKeditor.Config['DefaultLanguage']='en';
			<{else}>
				oFCKeditor.Config['DefaultLanguage']='zh-cn';
			<{/if}>
			oFCKeditor.BasePath		= 'lib/fckeditor/' ;
			oFCKeditor.ToolbarSet	= 'frant' ;
			oFCKeditor.Width=500;
			oFCKeditor.Height=220;
			oFCKeditor.Create() ;
			</script>
              <{/if}> </td>
          </tr>
          <tr>
            <th><{$lang.validTime}>:</th>
            <td  ><{foreach item=list key=num from=$validTime}> <input name="validTime" type="radio" value="<{$num}>" <{if $num==$de.valid_time}>checked="checked"<{/if}> />
              <{$list}> 
              <{/foreach}> </td>
          </tr>
          <tr>
            <th><font color="red">*</font><{$lang.picture}>:</th>
            <td><div id="pic_view"></div>
              <div id="overlay"></div>
              <input type="button"  value="<{$lang.add_pic}>" onclick="alertWin('<{$lang.add_pic}>','',550,430,'');" />
              <input name="pic" id="pic" type="hidden" value="" /></td>
          </tr>
          <tr>
            <th>上传附件:</th>
            <td><div id="attach_wrap">
                <div style="border:solid 1px #7FAAFF; background-color: #C5D9FF; padding:2px; display:inline-block;*display:inline;*margin-top:5px; margin-left:5px;"> <span disabled="disabled" id="spanButtonPlaceholder"></span> </div>
                <b id="divFileProgressContainer" style="line-height:21px;"></b>
                <div id="thumbnails">
                  <ul>
                    <{section name=li loop=$upload.upload_limit}>
                    <li uploadstatu='0'>
                      <div class="complete_statu"></div>
                      <h4></h4>
                    </li>
                    <{/section}>
                  </ul>
                </div>
              </div></td>
          </tr>
          <{if !$de}>
          <tr id="add_pro_tb" style="display:none">
            <td colspan="2" style="padding:0" ><table cellspacing="1" cellpadding="6" style="width:100%;margin:0; display:table-block" border="0">
                <tr id="fv_list" style="display:<{if $firstvalue.0!=''}>table-block<{else}>none<{/if}>;">
                  <td  colspan="2" class="smalltitle"><{$lang.pro_property}></td>
                </tr>
                <tr>
                  <td id="fv_box"  colspan="2" style="padding:0"><table width="100%" cellspacing="1" cellpadding="6">
                      <{foreach item=list key=num from=$firstvalue}>
                      <{$list}>
                      <{/foreach}>
                    </table></td>
                </tr>
                <tr>
                  <td colspan="2" class="smalltitle"><{$lang.o_freight}></td>
                </tr>
                <tr>
                  <th><{$lang.addr}>:</th>
                  <td><select  name="province" id="province" onChange="getHTML(this.value)" style="width:150px;" />
                    
                    <option value=""><{$lang.prov}></option>
                    <{$prov}>
                    </select>
                    <select name="city" id="city" style="width:150px;" />
                    
                    <option value=""><{$lang.city}></option>
                    </select></td>
                </tr>
                <tr>
                  <th valign="top"><{$lang.ship}>:</th>
                  <td><input onclick="$('wl').style.display='none'" checked="checked" name="freight_type" type="radio" value="1" />
                    <{$lang.sell_ship}><br />
                    <input onclick="$('wl').style.display='block'" <{if $de.freight_type==2}>checked="checked"<{/if}> name="freight_type" type="radio" value="2" /><{$lang.buy_ship}>
                    <div id="wl" style="background:#F8F8F8; padding:20px; display:none;<{if $de.freight_type==2}>display:block;<{/if}>"> <{$lang.postal_delivery}>
                      <input style="width:30px;" value="<{$de.freight.0}>" name="freight[]" type="text" />
                      <{$lang.express}>
                      <input style="width:30px;" value="<{$de.freight.1}>" name="freight[]" type="text" />
                      <{$lang.ems}>
                      <input style="width:30px;" value="<{$de.freight.2}>" name="freight[]" type="text" />
                    </div></td>
                </tr>
                <tr>
                  <td colspan="2" class="smalltitle"><{$lang.o_other_info}></td>
                </tr>
                <tr>
                  <th valign="top"><{$lang.stime}>:</th>
                  <td><input checked="checked" name="stime_type" type="radio" value="1" />
                    <{$lang.now}><br />
                    <input <{if $de.stime_type==2}>checked="checked"<{/if}> name="stime_type" type="radio" value="2" /><{$lang.set_time}>
                    <input value="<{$de.stime|date_format}>" onFocus="cdr.show(this);" readonly="readonly" name="stime" type="text" />
                    <br />
                    <input <{if $de.stime_type==3}>checked="checked"<{/if}> name="stime_type" type="radio" value="3" /><{$lang.add_lib}> </td>
                </tr>
                <tr>
                  <th><{$lang.amount}>:</th>
                  <td><input maxlength="7" name="amount" type="text" style="width:170px;" value="<{$de.amount}>"/>
                    <label id="pro_unit_des"></label></td>
                </tr>
                <tr>
                  <th><font color="red">*</font><{$lang.protypes}>:</th>
                  <td><select name="trade_type" id="trade_type">
                      <{foreach item=prot key=num from=$trade_type}> <{if $num>0}> <{if $num==$de.trade_type}>selected="selected"<{/if}> ><{$prot}><option value="<{$num}>" <{if $num==$de.trade_type}>selected="selected"<{/if}> ><{$prot}>
                      </option>
                      <{/if}> <{/foreach}>
                    </select></td>
                </tr>
                <tr>
                  <th><font color="red">*</font><{$lang.ptype}>:</th>
                  <td><{foreach item=list key=num from=$ptype}> <input name="ptype" type="radio" value="<{$num}>" <{if $num==$de.ptype}>checked="checked"<{/if}> /><{$list}>
                    <{/foreach}> </td>
                </tr>
                <tr>
                  <th><{$lang.invoice}>:</th>
                  <td><input name="invoice" type="radio" value="1" checked="checked" />
                    <{$lang.no}> <input name="invoice" type="radio" value="2" <{if $de.invoice==2}>checked="checked"<{/if}> /><{$lang.have}> </td>
                </tr>
                <tr>
                  <th><{$lang.maintenance}>:</th>
                  <td><input name="maintenance" type="radio" value="1" checked="checked" />
                    <{$lang.no}> <input name="maintenance" type="radio" value="2" <{if $de.maintenance==2}>checked="checked"<{/if}> /><{$lang.have}> </td>
                </tr>
                <tr>
                  <th><{$lang.rec_pro}>:</th>
                  <td><input <{if $de.rec_pro}>checked="checked"<{/if}> name="rec_pro" type="checkbox" value="1" /></td>
                </tr>
              </table></td>
          </tr>
          <{/if}>
          <{if !$buid}>
          <tr>
            <td colspan="2"><div class="smalltitle">
                <label>
                  <input type="radio" value="2" id="login_do" onChange="if(this.checked==true){toggleLogReg(this);}" name="user_action" checked >
                  &nbsp;已有帐号登录</label>
              </div></td>
          </tr>
          <tr>
            <td colspan="2"><table cellpadding="1" cellspacing="6" id="login_wrap" style="width:100%;display:block">
                <tr>
                  <th><{$lang.user_name}></th>
                  <td><input type="text" style="width:200px;" tabindex="1" maxlength="25" size="25" id="login_user" name="login_user" value=""></td>
                </tr>
                <tr>
                  <th><{$lang.user_pass}></th>
                  <td><input type="password" height="20" style="width:200px;" class="tstyle" tabindex="2" maxlength="25" size="25" id="login_password" name="login_password"></td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td colspan="2"><div class="smalltitle">
                <label>
                  <input type="radio" value="1" id="regist_do" onChange="if(this.checked==true){toggleLogReg(this);}" name="user_action">
                  &nbsp;用户注册</label>
              </div></td>
          </tr>
          <tr>
            <td colspan="2"><table style="width:100%;display:none" cellpadding="1" cellspacing="6" id="regist_wrap">
                <tr>
                  <th><{$lang.user_name}></th>
                  <td><input type="text" style="width:300px;" class="input" id="user" name="user">
                    <span id="tishi"></span></td>
                </tr>
                <tr>
                  <th><{$lang.user_pass}></th>
                  <td><input type="password" style="width:300px;" class="input" id="password" name="password" onfocus="check_user();"></td>
                </tr>
                <tr>
                  <th><{$lang.pass_reenter}></th>
                  <td><input type="password" style="width:300px;" class="input" size="20" id="re_password" name="re_password"></td>
                </tr>
                <tr>
                  <th>真实姓名:</th>
                  <td><input type="text" style="width:200px;" class="input" size="30" id="realnane" name="realname">
                    <label>
                      <input type="radio" checked="checked" value="1" name="sex">
                      &nbsp;先生</label>
                    &nbsp;&nbsp;
                    <label>
                      <input type="radio" value="2" name="sex">
                      &nbsp;女士</label></td>
                </tr>
                <tr>
                  <th>职位:</th>
                  <td><input type="text" style="width:300px;" maxlength="30" size="20" id="position" class="input" name="position">
                </tr>
                <tr>
                  <th><{$lang.email}></th>
                  <td><input type="text" style="width:300px;" maxlength="30" size="20" id="email" class="input" name="email">
                    <{$lang.email_msg}> 
                </tr>
                <tr>
                  <th>手机:</th>
                  <td><input type="text" style="width:300px;" class="input" size="30" id="mobile" name="mobile">
                </tr>
                <tr>
                  <th>传真:</th>
                  <td><input type="text" style="width:300px;" maxlength="30" size="20" id="fax" class="input" name="fax">
                </tr>
                <tr>
                  <th>QQ:</th>
                  <td><input type="text" style="width:300px;" maxlength="30" size="20" id="qq" class="input" name="qq">
                </tr>
                <tr>
                  <th>MSN:</th>
                  <td><input type="text" style="width:300px;" maxlength="30" size="20" id="msn" class="input" name="msn">
                </tr>
                <tr>
                  <th>注册协议:</th>
                  <td height="*" bgcolor="#FFFFFF" align="left" colspan="2"><textarea style="font-size:12px;algin:left;margin-top:5px; width:300px;" rows="5" name="trtext"><{$config.association}></textarea>
                    <br>
                    <label>
                      <input type="checkbox" style="margin-top:5px; vertical-align:text-bottom;" onclick="$('submitreg').disabled=false;" value="checkbox" id="readme" name="readme">
                      已阅读会员协议</label></td>
                </tr>
              </table></td>
          </tr>
          <tr>
            <td colspan="2"><div class="smalltitle">买家信息</div></td>
          </tr>
          <tr>
            <th>公司名称*</th>
            <td height="40" bgcolor="#FFFFFF" align="left" colspan="2"><input type="text" style="width:300px;" class="input" id="comname" name="comname"></td>
          </tr>
          <tr>
            <th>详细地址*</th>
            <td height="40" bgcolor="#FFFFFF" align="left" colspan="2"><input type="text" style="width:300px;" class="input" id="addr" name="addr"></td>
          </tr>
          <tr>
            <th>公司类型*</th>
            <td height="40" bgcolor="#FFFFFF" align="left" colspan="2"><input type="radio" value="生产型" name="ctype">
              生产型
              <input type="radio" value="贸易型" name="ctype">
              贸易型
              <input type="radio" value="服务型" name="ctype">
              服务型
              <input type="radio" value="代理型" name="ctype">
              代理型
              <input type="radio" value="政府或其他机构" name="ctype">
              政府或其他机构 </td>
          </tr>
          <tr>
            <th>主营行业*</th>
            <td height="40" bgcolor="#FFFFFF" align="left" colspan="2"><select onchange="getHTML(this.value,'tcatid')" id="catid" name="catid">
                <option selected="" value="">请选择行业类别</option>
                <option value="1001"> 汽车工业 </option>
              </select>
              <select onchange="getHTML(this.value,'scatid')" id="tcatid" name="tcatid" style="visibility:hidden">
              </select>
              <select id="scatid" name="scatid" style="visibility:hidden">
              </select></td>
          </tr>
          <tr align="right">
            <th>会员身份</th>
            <td align="left"><input type="radio" value="1" name="identity" checked="checked">
              买家
              <input type="radio" value="2" name="identity">
              卖家
              <input type="radio" value="3" name="identity">
              两者都是 </td>
          </tr>
          <{/if}>
          <tr>
            <td colspan="2"><div class="smalltitle"></div></td>
          </tr>
          <tr>
            <td align="center" colspan="2"><input type="submit" value="<{$lang.submit}>" style="width:50px;" <{if !buid}> id="submitreg"  disabled="disabled" <{/if}> onClick="return check_value()"/>
              <input name="submit" type="hidden"  id="submit" value="submit" /></td>
          </tr>
        </table>
      </form>
    </div>
  </div>
  <!--主体左侧结束 -->
  
  <!--主体右侧开始 -->
  <div class="rightbar">
    <div class="right1">
      <div class="sectitle" >
        <div class="title_left1 L2"><{$lang.rec_offer}></div>
      </div>
      <div class="seccon">
        <ul class="li_list">
          <{insert name="getOffers" leng="18" rec="true"  limit="8" img="true"}>
          <script src='<{$config.weburl}>/api/ad.php?id=14&catid=<{$smarty.get.id}>&sname=<{$sname}>'></script>
        </ul>
        <div class="clear"></div>
      </div>
    </div>
    <div class="right1 m1">
      <div class="sectitle" >
        <div class="title_left1 L2"><{$lang.new_offer}></div>
      </div>
      <div class="seccon" >
        <ul class="li_list">
          <{insert name="getOffers" leng="18" limit="8" img="true"}>
        </ul>
        <div class="clear"></div>
      </div>
    </div>
  </div>
  <!--主体右侧结束 -->
</div>
<!--主体结束 -->
<script>
function user_login(user,pwd){
	var url = '<{$config.weburl}>/?m=offer&s=add_offer';
	var sj = new Date();
	var pars = 'action=login'+'&user=' + user+'&password='+pwd;
	var myAjax = new Ajax.Request(
				url,
				{method: 'post', parameters: pars, onComplete: showResponse}
				);	
	function showResponse(originalRequest)
	{
		var tempStr = 'var MyMe = ' + originalRequest.responseText;
		eval(tempStr);
		if(MyMe){

		}
		return false;	
	}
}
function toggleLogReg(o){
	if(o.value==1){		
		Element.hide('login_wrap');
		Element.show('regist_wrap');
	}else{
		
		Element.hide('regist_wrap');
		Element.show('login_wrap');	
	}
}
function showCategory()
{
	var key= $('key_word').value;
	alertWin('<{$lang.product_category}>','',580,480,'<{$config.weburl}>/?m=offer&s=cate_show_ajax&key_word='+key);
}
function setCategory(catid)
{
	var url = '<{$config.weburl}>/?m=offer&s=cate_show_ajax&oper=ajax&call=get_cate';
	var sj = new Date();
	var pars = 'shuiji=' + sj+'&catid='+catid;
	var myAjax = new Ajax.Request(
				url,
				{method: 'post', parameters: pars, onComplete: showResponse}
				);
	function showResponse(originalRequest)
	{
		var tempStr = 'var MyMe = ' + originalRequest.responseText; 
		var i=0;var j=0;
		eval(tempStr);
		if(MyMe){
			$('sscatid').value = '';
			$('scatid').value = '';	
			$('tcatid').value = '';
			$('catid').value = '';
			if(catid.length>8)
				$('sscatid').value = catid;
			if(catid.length>6)
				$('scatid').value = catid.substr(0,8);	
			if(catid.length>4)
				$('tcatid').value = catid.substr(0,6);
			$('catid').value = catid.substr(0,4);
			
			$('cate_show').innerHTML= MyMe.cat;
			$('brand').innerHTML= MyMe.brand;
			$('fv_box').innerHTML = '<table width="100%">'+MyMe.firstvalue+'</table>';
			if($('fv_list'))
				$('fv_list').style.display=MyMe.firstvalue!=''?'':'none';
		}			

	 }
	close_win();
}
//--------------------------
var city='<{$de.city}>';
var province='<{$de.province}>';
function getHTML(v)
{	
	var ob="city";
	var url = '<{$config.weburl}>/ajax_back_end.php';
	var sj = new Date();
	var pars = 'shuiji=' + sj+'&prov_id='+v;
	var myAjax = new Ajax.Request(
				url,
				{method: 'post', parameters: pars, onComplete: showResponse}
				);
	function showResponse(originalRequest)
	{
		var tempStr = 'var MyMe = ' + originalRequest.responseText; 
		var i=0;var j=0;
		eval(tempStr);
		for(var s in MyMe)
		{
			++j;
		}
		$(ob).options.length =j+1;
		for(var k in MyMe)
		{
			var cityId=MyMe[k][0];
			var ciytName=MyMe[k][1];
			$(ob).options[k].value = cityId;
			$(ob).options[k].text = ciytName;
			if(city!=''&&city==ciytName)
				$(ob).options[k].selected = true;
	　	}
	 }
　}
<{if $de.city}>
getHTML('<{$de.province}>');
<{/if}>
//==========================================
function check_value()
{
	/*if(!$('title').value)
	{
		alert('<{$lang.notice_title}>');
		$('title').focus();
		return false;
	}
	if($('catid').value=='')
	{
		alert('<{$lang.product_category}>');
		return false;
	}
	if($('con').value.length>199) 
	{
		alert("<{$lang.sumisbig}>");
		return false;
	}
	if(!$('con').value) 
	{
		alert("<{$lang.notice_con}>");
		return false;
	} 
    var fck = FCKeditorAPI.GetInstance("detail");
    var content = fck.GetXHTML(true);
    if (content.replace(/<(?!img|input|object)[^>]*>|\s+/ig, "") == "")
	{
	   alert("<{$lang.notice_detail}>");
	   fck.Focus();
	   return false;
    }
	//============
	if($('add_pro_online')&&$('add_pro_online').checked==true){
		if($('price').value)
		{
			var str = $('price').value;
			if(!str.match(/^(:?(:?\d+.\d+)|(:?\d+))$/))
			{
				alert('产品价格错误');
				$('price').focus();
				return false;
			}
		}
		else
		{
			alert('请填写产品价格');
			$('price').focus();
			return false;
		}
		if($('amount').value)
		{
			var str = $('amount').value;
			if(!str.match(/^(:?(:?\d+.\d+)|(:?\d+))$/))
			{
				alert('库存数量错误');
				$('amount').focus();
				return false;
			}
		}
	}*/
	if($('regist_do').checked==true)
		return check();
	if($('login_do').checked==true)
	{
		if($('login_user').value.length < 1)
		{
			alert(nousername);
			$('login_user').focus();
			return false;
		}
		if($('login_password').value.length < 1)
		{
			alert(nouserpass);
			$('login_password').focus();
			return false;
		}
		return user_login( $('login_user').value,$('login_password').value );
	}
}
</script>
